<?php defined('BASEPATH') or exit('No direct script access allowed');

class Module_Be_product extends Module {

	public $version = 1.1;

	public function info()
	{
		return array(
			'name' => array(
				'es' => 'Products',
				'en' => 'Products'
			),
			'description' => array(
				'es' => 'Products Management',
				'en' => 'Products Management'
				),
			'frontend' => TRUE,
			'backend' => TRUE,
			'skip_xss'	=> TRUE,
			'menu'		=> 'users',
			'shortcuts' => array(
				array(
			 	   'name' => 'escort_product_export_whole_list_label',
				    'uri' => 'admin/be_product/export_whole_list',
				    'class' => 'export'
				),
				array(
			 	   'name' => 'escort_product_add_title',
				    'uri' => 'admin/be_product/create',
				    'class' => 'add'
				),
			),
		);
	}

	public function install()
	{
		return $this->db->query("
			CREATE  TABLE IF NOT EXISTS ".$this->db->dbprefix('escort_products')." (
  				 `id` INT NOT NULL AUTO_INCREMENT ,
				  `product_ref` VARCHAR(45) NULL ,
				  `price` FLOAT NULL ,
				  `package_ids` VARCHAR(255) NULL,
				  `description` VARCHAR(255) NULL ,
				  `created_time` INT NULL ,
			  PRIMARY KEY (`id`)
			) ENGINE=InnoDB DEFAULT CHARSET=utf8
		");
	}

	public function uninstall()
	{
		return TRUE;
	}

	public function upgrade($old_version)
	{
		// Your Upgrade Logic
		return TRUE;
	}

	public function help()
	{
		// Return a string containing help info
		// You could include a file and return it here.
		return "This module has no inline docs as it does not have a back-end.";
	}
}
/* End of file details.php */